/* ===== MIGLIORAMENTI FORM DI PRENOTAZIONE ===== */

/* Gestione calendario migliorata */
.ui-datepicker {
    z-index: 9999 !important;
    position: absolute !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
}

.bookingform {
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
}

.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 9998;
    display: none;
    cursor: pointer;
}

/* Loading indicators */
.price-container {
    position: relative;
    transition: opacity 0.3s ease;
    min-height: 100px;
}

.price-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.price-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #fe6634;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Miglioramenti form */
.form-error {
    color: #d9534f;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

.form-success {
    color: #5cb85c;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px;
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Miglioramenti dropdown */
.form-control, select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, select:focus {
    border-color: #fe6634;
    box-shadow: 0 0 5px rgba(254, 102, 52, 0.3);
    outline: none;
}

/* Miglioramenti pulsanti */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Effetto ripple sui pulsanti */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Miglioramenti responsive */
@media (max-width: 768px) {
    .bookingform {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: white;
        overflow-y: auto;
        padding: 20px;
        margin: 0;
    }
    
    .closebook {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 24px;
        font-weight: bold;
        cursor: pointer;
        z-index: 10000;
    }
    
    .calendar-overlay {
        z-index: 9997;
    }
    
    .ui-datepicker {
        z-index: 10001 !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90vw;
    }
}

/* Animazioni smooth per transizioni */
.bookingform {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Miglioramenti accessibilità */
.calendar-input:focus,
.form-control:focus {
    outline: 2px solid #fe6634;
    outline-offset: 2px;
}

/* Indicatori di stato */
.price-updated {
    animation: priceUpdate 0.5s ease;
}

@keyframes priceUpdate {
    0% { background-color: transparent; }
    50% { background-color: rgba(254, 102, 52, 0.1); }
    100% { background-color: transparent; }
}

/* Miglioramenti tooltip */
.tooltip {
    z-index: 10002 !important;
}

/* Gestione errori calendario */
.calendar-error {
    border-color: #d9534f !important;
    box-shadow: 0 0 5px rgba(217, 83, 79, 0.3) !important;
}

/* Stato disabilitato migliorato */
.form-control[disabled],
.form-control[readonly] {
    background-color: #f9f9f9;
    opacity: 0.8;
    cursor: not-allowed;
}

/* Miglioramenti per il codice promozionale */
#promoCode {
    position: relative;
}

#promoCode .btnGo {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #fe6634;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

#promoCode .btnGo:hover {
    background: #e55a2b;
}

/* Miglioramenti sezioni prezzo */
.sconto_div,
.total_div,
.anticiposaldo_div {
    border-left: 3px solid #fe6634;
    padding-left: 10px;
    margin: 10px 0;
}

.newPrice {
    font-weight: bold;
    color: #fe6634;
}

/* Effetti hover per elementi interattivi */
.calendario:hover {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

